home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_tripwire.idb / usr / freeware / lib / tripwire / README.cdf.z / README.cdf
Encoding:
Internet Message Format  |  1999-04-16  |  8.1 KB

  1. From:    "Cory F. Cohen" <syscory@starbase.spd.louisville.edu>
  2. To:      spaf
  3. Subject: Tripwire holes in HPUX...
  4. Date:    Fri, 04 Mar 94 10:27:22 -0500
  5.  
  6. I have a feature fix for tripwire....
  7.  
  8. In HPUX there are these dandy little files called context dependent
  9. files.  They're used for HP-UX clustering, and they leave GREAT BIG
  10. holes in programs like tripwire. (and everything else :-( )
  11.  
  12. --- very short descritpion of CDF's (context dependent files) ----------
  13. They were created for supporting multiple binary architectures in one
  14. cluster.  HPUX processes have something called a context to determine
  15. which file to run.  Oh hell, take a look at the script output I sent
  16. if you're not familiar with them...
  17. ------------------------------------------------------------------------
  18.  
  19. Anyway, I've summarized my changes to config.parse.c below, sent you
  20. a complete config.parse.c, and some script output demonstrating
  21. CDF's and how they really screw-up tripwire.
  22.  
  23. I make no commitments as to the accuracy of this code. Two bugs: (?)
  24.  1) strcat(MAXPATHLEN, "+") into a MAXPATHLEN array
  25.     I'm not sure how HP deals with this.
  26.  2) CDF's still get screwed up if someone creates a file ending with "+"
  27.     (But even HP's got this part screwed up... :-) )
  28.  
  29. ------- Message 3
  30.  
  31. From:    "Cory F. Cohen" <syscory@starbase.spd.louisville.edu>
  32. To:      spaf
  33. Subject: HPUX CDF Script
  34. Date:    Fri, 04 Mar 94 10:31:45 -0500
  35.  
  36. This is the best way I know to describe the little buggers.
  37.  
  38. Script started on Fri Mar  4 09:52:56 1994
  39. #
  40. # A little setup...
  41. #
  42. bash# mkdir example
  43. bash# cd example
  44. bash# ls -Fla
  45. total 8
  46. drwx------   2 root     sys           24 Mar  4 09:53 ./
  47. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  48. bash# mkdir a
  49. bash# echo >a/a1
  50. bash# echo >a/a2
  51. bash# ls -Fla
  52. total 12
  53. drwx------   3 root     sys         1024 Mar  4 09:53 ./
  54. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  55. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  56. bash# ls -Fla a
  57. total 16
  58. drwx------   2 root     sys         1024 Mar  4 09:53 ./
  59. drwx------   3 root     sys         1024 Mar  4 09:53 ../
  60. -rw-------   1 root     sys            1 Mar  4 09:53 a1
  61. -rw-------   1 root     sys            1 Mar  4 09:53 a2
  62. bash# mkdir h
  63. bash# echo >h/h1
  64. bash# echo >h/h2
  65. bash# ls -Fla
  66. total 16
  67. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  68. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  69. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  70. drwx------   2 root     sys         1024 Mar  4 09:53 h/
  71. bash# ls -Fla h
  72. total 16
  73. drwx------   2 root     sys         1024 Mar  4 09:53 ./
  74. drwx------   4 root     sys         1024 Mar  4 09:53 ../
  75. -rw-------   1 root     sys            1 Mar  4 09:53 h1
  76. -rw-------   1 root     sys            1 Mar  4 09:53 h2
  77. #
  78. # Here's where the fun stuff starts...
  79. #
  80. bash# chmod +H h
  81. #
  82. # h is now a hidden directory (a context dependent file (CDF))
  83. #
  84. bash# ls -Fla
  85. total 12
  86. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  87. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  88. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  89. #
  90. # Hey! Where did it go?
  91. #
  92. bash# ls -Fla h
  93. h not found
  94. bash# ls -FlaH
  95. total 16
  96. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  97. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  98. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  99. Hrws------   2 root     sys         1024 Mar  4 09:53 h+
  100. #
  101. # Oh there it is, with a plus after it and a suid bit!
  102. #
  103. bash# ls -Fla h+
  104. total 16
  105. drws------   2 root     sys         1024 Mar  4 09:53 ./
  106. drwx------   4 root     sys         1024 Mar  4 09:53 ../
  107. -rw-------   1 root     sys            1 Mar  4 09:53 h1
  108. -rw-------   1 root     sys            1 Mar  4 09:53 h2
  109. #
  110. # Here's what it's really for...
  111. #
  112. bash# hostname
  113. starbase
  114. bash# echo >h+/starbase "Isn't this nifty"
  115. bash# ls -Fla
  116. total 16
  117. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  118. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  119. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  120. -rw-------   1 root     sys           17 Mar  4 09:54 h
  121. #
  122. # Plain old h is back...
  123. #
  124. bash# cat h
  125. Isn't this nifty
  126. #
  127. # but h+ is still there too.
  128. #
  129. bash# ls -Fla h+
  130. total 20
  131. drws------   2 root     sys         1024 Mar  4 09:54 ./
  132. drwx------   4 root     sys         1024 Mar  4 09:53 ../
  133. -rw-------   1 root     sys            1 Mar  4 09:53 h1
  134. -rw-------   1 root     sys            1 Mar  4 09:53 h2
  135. -rw-------   1 root     sys           17 Mar  4 09:54 starbase
  136. #
  137. # It'll match any of the words in this list...
  138. #
  139. bash# getcontext
  140. starbase PA-RISC1.1 HP-PA localroot default
  141. #
  142. # Let's try an architecture dependent one...
  143. #
  144. bash# echo >h+/HP-PA "This is for all HP-PA hosts"
  145. #
  146. # h is still there...
  147. #
  148. bash# ls -Fla
  149. total 16
  150. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  151. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  152. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  153. -rw-------   1 root     sys           17 Mar  4 09:54 h
  154. #
  155. # But it's the old one.
  156. #
  157. bash# cat h
  158. Isn't this nifty
  159. #
  160. # It matches in order...
  161. #
  162. bash# rm h+/starbase
  163. bash# cat h 
  164. This is for all HP-PA hosts
  165. #
  166. # Are you confused yet?
  167. #
  168. bash# ls -Fla 
  169. total 16
  170. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  171. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  172. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  173. -rw-------   1 root     sys           28 Mar  4 09:57 h
  174. #
  175. # I thought so :-)
  176. #
  177. bash# chmod 700 h+
  178. bash# ls -Fla
  179. total 16
  180. drwx------   4 root     sys         1024 Mar  4 09:53 ./
  181. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  182. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  183. drwx------   2 root     sys         1024 Mar  4 09:57 h/
  184. #
  185. # My code doesn't fix this... HP will have to...
  186. #
  187. bash# echo >h+ "HPUX hates this"
  188. #
  189. # h+ is a file and h is a normal directory...
  190. #
  191. bash# ls -Fla
  192. total 20
  193. drwx------   4 root     sys         1024 Mar  4 09:58 ./
  194. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  195. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  196. drwx------   2 root     sys         1024 Mar  4 09:57 h/
  197. -rw-------   1 root     sys           16 Mar  4 09:58 h+
  198. #
  199. # But not for long...
  200. #
  201. bash# chmod +H h
  202. #
  203. # Now h AND h+ are files...
  204. #
  205. bash# ls -FlaH
  206. total 20
  207. drwx------   4 root     sys         1024 Mar  4 09:58 ./
  208. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  209. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  210. -rw-------   1 root     sys           28 Mar  4 09:57 h
  211. -rw-------   1 root     sys           16 Mar  4 09:58 h+
  212. #
  213. # All files...
  214. #
  215. bash# ls -Fla h+
  216. -rw-------   1 root     sys           16 Mar  4 09:58 h+
  217. bash# ls -FlaH h+
  218. -rw-------   1 root     sys           16 Mar  4 09:58 h+
  219. bash# ls -Fla h
  220. -rw-------   1 root     sys           28 Mar  4 09:57 h
  221. #
  222. # h/h1 and h/h2 are GONE!
  223. #
  224. # People could still hide stuff from tripwire this way, since
  225. # HP can't even find the damn things...
  226. #
  227. # Let's remove the offfending h+ FILE.
  228. #
  229. bash# rm h+
  230. bash# ls -FlaH
  231. total 16
  232. drwx------   4 root     sys         1024 Mar  4 09:59 ./
  233. drwx------   7 root     sys         1024 Mar  4 09:53 ../
  234. drwx------   2 root     sys         1024 Mar  4 09:53 a/
  235. Hrws------   2 root     sys         1024 Mar  4 09:57 h+
  236. #
  237. # Didn't I just rm h+?
  238. #
  239. bash# ls -Fla h+
  240. total 20
  241. drws------   2 root     sys         1024 Mar  4 09:57 ./
  242. drwx------   4 root     sys         1024 Mar  4 09:59 ../
  243. -rw-------   1 root     sys           28 Mar  4 09:57 HP-PA
  244. -rw-------   1 root     sys            1 Mar  4 09:53 h1
  245. -rw-------   1 root     sys            1 Mar  4 09:53 h2
  246. #
  247. # Oh... It's the directory again... And are files are back!
  248. #
  249. # Just think. I have these CUTE little things ALL OVER
  250. # my system.  /tmp, /etc, /dev, /bin, everywhere..
  251. # I think it's a miracle that people haven't helped
  252. # themselves to all my disk space...
  253. #
  254. # Hope that helps...
  255. #
  256. bash# exit
  257. script done on Fri Mar  4 09:59:43 1994
  258.  
  259. Hope this helped if you're not familiar with CDF's.  Most people
  260. I've met running HPUX don't even know they exist unless they run
  261. in a clustered environment like I do.
  262.  
  263. Cory
  264. --
  265. ======================================================================
  266. Cory Forrest Cohen                        
  267. University of Louisville
  268. syscory@starbase.spd.louisville.edu
  269. ======================================================================
  270.  
  271. ------- End of Forwarded Messages
  272.  
  273.  
  274.